import request from '@/utils/request'

// 文件上传
export function uploadFile(data) {
    return request({
        url: '/file/upload',
        method: 'post',
        headers: {
            'Content-Type': undefined // 让 axios 自动设置 Content-Type 为 multipart/form-data
        },
        data: data
    })
}

// 获取文件信息
export function getFileInfo(fileId) {
    return request({
        url: '/file/info/' + fileId,
        method: 'get'
    })
}

// 删除文件
export function deleteFile(fileId) {
    return request({
        url: '/file/delete/' + fileId,
        method: 'delete'
    })
} 